/*
 * 平台公共请求
 * 240812
 *
 */

import { http } from "@/utils/http";
import { baseUrlApi } from "@/store/utils";

// 获取项目列表
export const getProjectList = (params?: object) => {
  return http.request("get", baseUrlApi("project/list"), { params });
};

// 获取审批流列表
export const getAuditHistoryTaskList = (params?: object) => {
  return http.request("get", baseUrlApi("audit/history/task/list"), {
    params
  });
};

// 获取待办/已办事项列表
export const getAuditTaskList = (params?: object) => {
  return http.request("get", baseUrlApi("audit/task/list"), { params });
};

// 获取材料分类树
export const getMaterialCategoryTree = (params?: object) => {
  return http.request("get", baseUrlApi("material/category/tree"), {
    params
  });
};

// 审批时获取相关文件数据详情（项目订单）
export const getAuditFileInfoForPjctOd = (params?: object) => {
  return http.request("get", baseUrlApi("projectOrder/audit/attachment/info"), {
    params
  });
};

// 审批时保存相关文件数据详情（项目订单）
export const saveAuditFileInfoForPjctOd = (data?: object) => {
  return http.request(
    "post",
    baseUrlApi("projectOrder/audit/attachment/save"),
    {
      data
    }
  );
};

// 材料导出
export const exportMaterialListFile = (params?: object) => {
  return http.request("get", baseUrlApi("contract/export/material/file"), {
    params
  });
};
